package com.ruoyi.purchase.service.impl;

import com.ruoyi.purchase.domain.LogisticDetail;
import com.ruoyi.purchase.mapper.LogisticDetailMapper;
import com.ruoyi.purchase.service.ILogisticDetailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * LogisticDetailService业务层处理
 * 
 * @author kevinness
 * @date 2025-02-01
 */
@Service
public class LogisticDetailService implements ILogisticDetailService
{
    @Autowired
    private LogisticDetailMapper logisticDetailMapper;

    /**
     * 查询LogisticDetail
     * 
     * @param id LogisticDetail主键
     * @return LogisticDetail
     */
    @Override
    public LogisticDetail selectLogisticDetailById(Long id)
    {
        return logisticDetailMapper.selectLogisticDetailById(id);
    }

    /**
     * 查询LogisticDetail列表
     * 
     * @param logisticDetail LogisticDetail
     * @return LogisticDetail
     */
    @Override
    public List<LogisticDetail> selectLogisticDetailList(LogisticDetail logisticDetail)
    {
        return logisticDetailMapper.selectLogisticDetailList(logisticDetail);
    }

    /**
     * 新增LogisticDetail
     * 
     * @param logisticDetail LogisticDetail
     * @return 结果
     */
    @Override
    public int insertLogisticDetail(LogisticDetail logisticDetail)
    {
        return logisticDetailMapper.insertLogisticDetail(logisticDetail);
    }

    /**
     * 修改LogisticDetail
     * 
     * @param logisticDetail LogisticDetail
     * @return 结果
     */
    @Override
    public int updateLogisticDetail(LogisticDetail logisticDetail)
    {
        return logisticDetailMapper.updateLogisticDetail(logisticDetail);
    }

    /**
     * 批量删除LogisticDetail
     * 
     * @param ids 需要删除的LogisticDetail主键
     * @return 结果
     */
    @Override
    public int deleteLogisticDetailByIds(Long[] ids)
    {
        return logisticDetailMapper.deleteLogisticDetailByIds(ids);
    }

    /**
     * 删除LogisticDetail信息
     * 
     * @param id LogisticDetail主键
     * @return 结果
     */
    @Override
    public int deleteLogisticDetailById(Long id)
    {
        return logisticDetailMapper.deleteLogisticDetailById(id);
    }

    /**
     * 根据订单编号查询所有的物流详情
     *
     * @param orderNo 订单编号
     * @return 物流详情
     */
    @Override
    public List<LogisticDetail> selectLogisticDetailByOrderNo(String orderNo){
        return logisticDetailMapper.selectLogisticDetailByOrderNo(orderNo);
    }
}
